package cn.kgc.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

/**
 * Created by teacher ZHANG on 2022/11/23
 */
@Data
@TableName(value = "comment", resultMap = "commentMap")
public class Comment {
    @TableId(type = IdType.AUTO)
    private Integer commentId;
    private String content;
    private Integer articleId;
    //返回Json字符串时，日期的转换格式
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @TableField(exist = false)
    private Author author;
}
